﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AUCS
{
    public partial class ServerInfo : Form
    {
        public string hostName;
        public int port;

        public ServerInfo(string serverHostname, int serverPort)
        {
            InitializeComponent();

            hostNameTextBox.Text = serverHostname;
            portNumeric.Value = serverPort;
        }

        void returnValues()
        {
            hostName = hostNameTextBox.Text;
            port = (int)portNumeric.Value;
            this.Close();
        }

        void TextBox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Return)
            {
                e.Handled = true;
                returnValues();
            }
        }

        private void submitBtn_Click(object sender, EventArgs e)
        {
            returnValues();
        }
    }
}
